<?
session_start();
$LN = $_SESSION['lang'];
if(!isset($LN)){
	$LN = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 4);
	$LN = (preg_match("/zh/i", $LN))?'cn':'en';
}
$LP = ($LN=='cn'? '/':'/'.$LN.'/');
require_once(ROOT.'/lang/'.$LN.'.php');
$MsgJs = $Msg['javascript'];
//
function output($pf, $hf){
	$b = true;
	if (file_exists($hf)){
		$ht = filemtime($hf);
		$pt = filemtime($pf);
		$b = ($ht+10 < time() || $pt > $ht);
	}
	if($b){
		$c = ob_get_contents();
		file_put_contents($hf, $c);
	}
}
//if(ereg('gzip',$_SERVER['HTTP_ACCEPT_ENCODING']) && Extension_Loaded('zlib')){
//	ob_start('ob_gzhandler');
//}else{
	ob_start();
//}
//header("Cache-Control: must-revalidate");
$gmd = gmdate("D, d M Y H:i:s", time() + 60*60*24);
//header("Expires: ".$gmd." GMT");
?>
